package com.hua.designpattern.creational.abstractfactory;

public class ShapeFactory implements AbstractFactory {

	@Override
	public Shape getShapeBean(String shape) {
		if ("CIRCLE".equalsIgnoreCase(shape)) {
			return new Circle();
		} else if ("RECTANGLE".equalsIgnoreCase(shape)) {
			return new Rectangle();
		} else {
			System.err.println("no shape named " + shape + " can created");
			throw new NullPointerException();
		}
	}

	@Override
	public Color getColorBean(String color) {
		// TODO Auto-generated method stub
		return null;
	}

}
